//
//  BNTabLayout.swift
//  BNUQuoteTrade
//
//  Created by bebull on 2021/12/22.
//

import Foundation
import UIKit

class BNTabLayout {
//    /// 标题颜色，默认#9FB0CA
//    var titleColor = UIColor(white: 1.0, alpha: 0.6)
//    /// 标题选中颜色，默认#2F79FF
//    var titleSelectedColor = UIColor(red: 47 / 255.0, green: 121 / 255.0, blue: 1.0, alpha: 1.0)
//    /// 标题字体，默认14号苹方
//    var titleFont = UIFont.systemFont(ofSize: 14)
//    /// 标题选中字体, 默认14号苹方Medium
//    var titleSelectedFont = UIFont.systemFont(ofSize: 14, weight: .medium)
    
    /// 左右起始间距，默认值为20
    /// 若leftAlign为NO,且计算总宽度少于TabView宽度,q会自动适配间距
    /// 规则为lrMargin = tabMargin / 2
    var lrMargin: CGFloat = 20
    /// 左对齐，默认为NO
    var leftAlign: Bool = false
    
    /// Tab间间距，默认值为30
    /// 若leftAlign为NO，
    /// 且计算总宽度少于TabView宽度,会自动适配间距
    /// 间距不为0,规则为lrMargin = tabMargin / 2
    /// 间距为0,规则为中间间距自动拉伸
    var tabMargin: CGFloat = 30
    
    /// Tab内间距，默认值为0
    var tabPadding: CGFloat = 0.0
    /// Tab固定宽度，默认值为0
    /// 若值为0，则宽度与当前Tab标题宽度相等
    /// 若值为0，则宽度= 当前Tab标题宽度 + 2*tabPadding
    var tabWidth: CGFloat = 0.0
    /// Tab选中颜色，默认为clearColor
    var tabSelectedColor: UIColor = .clear
    /// Tab颜色，默认为clearColor
    var tabColor: UIColor = .clear
    
    /// 底部线条颜色，默认#2F79FF
    var lineColor = UIColor(red: 47 / 255.0, green: 121 / 255.0, blue: 1.0, alpha: 1.0)
    /// 底部线条高度，默认值为2
    var lineHeight: CGFloat = 2.0
    /// 底部线条内边距，默认值为0
    var linePadding: CGFloat = 0.0
    /// 底部线条圆角，默认值为0
    var lineCornerRadius: CGFloat = 0.0
    
    /// 底部线条宽度，默认值为0
    /// 若值为0，则宽度与tabWidth相等
    var lineWidth: CGFloat = 0.0
    
    /// 底部线条是否隐藏，默认值为NO
    var lineHidden: Bool = false
    
    /// 点击Tab时，底部线条是滚动，默认值为NO
    var lineScrollDisable: Bool = false
    
    
    
    class func defaultLayout() -> BNTabLayout {
        let layout = BNTabLayout()
        layout.tabMargin = 30
        layout.tabPadding = 0
        layout.lineWidth = 28
        
        return layout
    }
    
}
